<?php if (!defined('BASEPATH')) exit('No direct script access allowed');


class Artikel extends CI_Model{
private $author;
private $created;
private $headline;
private $teaser;
private $text;
	function __construct()
	{
		parent::__construct();
	}

	public function get_articles(){
		$this->db->select('A.date, A.headline, A.teaser, A.text, U.username');
		$this->db->from('articles A, users U');
		$this->db->join('users', 'A.author = U.id');
		$query = $this->db->get();

		$returnArray = array();
		foreach ($query->result() as $row)
		{
		    $returnArray[] = $row;
		}
		
		return $returnArray;


	}
}